import { ArrayMaxSize, IsArray, IsBoolean, IsNumber, IsOptional, IsString, Max, MaxLength, Min } from "class-validator";

export default class CreateDto{
    @MaxLength(30)
    @IsString()
    name:string;

    @MaxLength(11)
    @IsString()
    @IsOptional()
    tel:string;

    @MaxLength(30)
    @IsString()
    @IsOptional()
    adminName:string;

    @MaxLength(30)
    @IsString()
    adminAccount:string;

    @MaxLength(30)
    @IsString()
    @IsOptional()
    adminPassword:string;

    @Max(1)
    @Min(0)
    @IsNumber()
    profitRate:number


    @IsBoolean()
    @IsOptional()
    enable:boolean;

    @MaxLength(100)
    @IsString()
    @IsOptional()
    remark:string;

    @ArrayMaxSize(100)
    @IsArray()
    @IsOptional()
    roles:number[]
}